import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-10-09
 * Time: 11:26
 */
public class Test1 {
    public static void main(String[] args) {

Scanner input = new Scanner(System.in);

        System.out.print("请输入一个整数：");

        int num = input.nextInt();


        String s = toBinary(num);

        System.out.println("整数的二进制串是：" + s);


    }


    public static String toBinary(int value) {

        String s = "";

        while (value != 0) {

            int r = value % 2; // 反复除以2取余数

            s = r + s;

            value = value / 2;

        }

        return s;

    }

}
